package com.itheima.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.mapper.RoleUserMapper;
import com.itheima.pojo.RoleUser;
import com.itheima.service.RoleUserService;
import org.apache.dubbo.config.annotation.Service;

@Service
public class RoleUserServiceImpl extends ServiceImpl<RoleUserMapper, RoleUser> implements RoleUserService {


    //删除角色
    @Override
    public boolean deleteByRoleId(Long id) {
        this.removeById(id);
        return true;
    }

    //根据角色ID删除中间表
    public boolean deleteUserIds(Long id){
        this.baseMapper.deleteUserIds(id);
        return true;
    }

    //根据角色查询所有的用户
    public Long[] findUsers(Long id){
        Long[] userIds = this.baseMapper.findUsers(id);
        return userIds;
    }
}
